package com.niuwa.p2p.core.constant;

/**
 * 
 * @title 易宝返回接口code值
 *
 * @author tennyqin
 * @version 1.0
 * @created 2015年4月10日
 */
public enum YeePayCodeEnum implements IEnum {

	Suceess(1, "成功"), Fail(0, "失败"), XmlError(2, "xml参数错误"), SignError(3,
			"签名认证失败"), IsNotExits(101, "引用了不存在的对象"), BusError(102, "业务状态不正确"), NotRun(
			103, "由于业务限制导致业务不能执行"), NameError(104, "实名认证失败");
	private int value;
	private String text;

	private YeePayCodeEnum(int value, String text) {
		this.value = value;
		this.text = text;
	}

	@Override
	public int getValue() {
		return this.value;
	}

	@Override
	public String getText() {
		return this.text;
	}

	@Override
	public String toString() {
		return this.getText();
	}

	public static YeePayCodeEnum valueOf(int value) {
		for (YeePayCodeEnum e : YeePayCodeEnum.values()) {
			if (e.getValue() == value) {
				return e;
			}
		}
		return null;
	}

}
